#include"SList251018.h"

//void test()
//{
//	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
//	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
//	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
//	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
//
//	node1->data = 1;
//	node2->data = 1;
//	node3->data = 1;
//	node4->data = 1;
//
//	node1->next = node2;
//	node2->next = node3;
//	node3->next = node4;
//	node4->next = NULL;
//
//	SLTPrint(node1);
//}

void test01()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPrint(plist);
	SLTPushBack(&plist, 2);
	SLTPrint(plist);
	SLTPushBack(&plist, 6);
	SLTPrint(plist);
	SLTPushBack(&plist, 3);
	SLTPrint(plist);

	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTPushFront(&plist, 8);
	SLTPrint(plist);
	SLTPopBack(&plist);
	SLTPrint(plist);
	SLTInsertAfter(plist, 8);
	SLTPrint(plist);

	SLTPopFront(&plist);
	SLTPrint(plist);
	SLTNode* find = SLTFind(plist, 1);
	SLTNode* find2 = SLTFind(plist, 6);

	if (find == NULL)
		printf("not find\n");
	else printf("find already\n");
	SLTInsert(&plist, find, 8);
	SLTPrint(plist);
	SLTErase(&plist, find);
	SLTPrint(plist);
	SLTPushFront(&plist, 89);
	SLTPrint(plist);

	SLTEraseAfter(find2);
	SLTPrint(plist);
	SListDestroy(&plist);
	SLTPrint(plist);

}
int main()
{
	test01();
	return 0;
}